package com.wxc;

import com.wxc.printer.BinaryTreeInfo;

import java.util.Comparator;

/**
 * @author wxc
 * @date 2021年08月28日 20:56
 */
public abstract class AbstractHeap<E> implements Heap<E> {

    protected int size;
    protected Comparator<E> comparator;

    public AbstractHeap(Comparator<E> comparator) {
        this.comparator = comparator;
    }

    public AbstractHeap() {
        this(null);
    }

    @Override
    public int size() {
        return size;
    }

    @Override
    public boolean isEmpty() {
        return size == 0;
    }

}
